package routers

import (
	"github.com/gin-gonic/gin"
	v1 "perfect-admin/api/v1"
	"perfect-admin/middleware"
)

func InitRoleRouter(Router *gin.RouterGroup)  {
	RoleRouter := Router.Group("roles").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
	{
		RoleRouter.GET("/getRoleList", v1.GetRoleList)
		RoleRouter.POST("/addOneRole", v1.AddOneRole)
		RoleRouter.PUT("/updateRole", v1.UpdateRole)
		RoleRouter.DELETE("/deleteRole", v1.DeleteRole)
		RoleRouter.DELETE("/deleteRoleRight", v1.DeleteRoleRight)
		RoleRouter.GET("/getAllRoleMenuTree", v1.GetAllRoleMenuTree)
		RoleRouter.PUT("/allotMenus", v1.AllotMenus)
	}
}
